package com.xixiake.immersive;

import android.content.Context;
import android.content.res.Resources;
import android.os.Build;

/**
 * Created by c-wanghengli on 2017/4/3.
 */
public class ImmersiveUtil {

    public static int is_support_inmersive = -1;


    public static int getStatusBarHeight(Context context){
        int result = 0;
        Resources resources = context.getResources();
        int resourcesId = resources.getIdentifier("status_bar_height","dimen","android");
        if(resourcesId>0){
            result = resources.getDimensionPixelOffset(resourcesId);
        }
        return result;
    }

    public static int isSupportImmersive(){
        if(is_support_inmersive != -1){
             return is_support_inmersive;
        }
        if(Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT){
            is_support_inmersive = 0;
        }
        String manufacturer = Build.MANUFACTURER.toUpperCase();
        if(manufacturer.equals("BBK")||manufacturer.equals("VIVO")){
            is_support_inmersive = 0;
        }else{
            is_support_inmersive = 1;
        }
        return is_support_inmersive;
    }

}
